//
//  SPDefaultAnnotation.m
//  SPMapKit
//
//  Created by zhangbo on 2017/9/8.
//  Copyright © 2017年 zhangbo. All rights reserved.
//

#import "SPDefaultAnnotation.h"

@implementation SPDefaultAnnotation

-(instancetype) init
{
    self = [super init];
    if (self) {
        self.title = @"";
        self.subtitle = @"";
        _identityKey = [NSString stringWithFormat:@"%@%@", NSStringFromClass([self class]), [self uuid]];
    }
    
    return self;
}

-(instancetype) initWithLocation:(CLLocationCoordinate2D) coordinate
{
    self = [super init];
    if (self) {
        self.coordinate = coordinate;
        self.title = @"";
        self.subtitle = @"";
        _identityKey = [NSString stringWithFormat:@"%@%@", NSStringFromClass([self class]), [self uuid]];
    }
    
    return self;
}

-(NSString*) identityKey
{
    return _identityKey;
}

-(NSString*) uuid
{
    CFUUIDRef uuidObject = CFUUIDCreate(kCFAllocatorDefault);
    // Get the string representation of CFUUID object.
    NSString *uuidStr = (NSString *)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, uuidObject));
    CFRelease(uuidObject);
    return uuidStr;
}

@end

@implementation SPDefaultOverlay

-(CGRect) mapRect
{
    return CGRectZero;
}

-(NSString*) identityKey
{
    return [NSString stringWithFormat:@"%@%@", NSStringFromClass([self class]), self.title];
}

@end
